'OutStandingIssues: Finir les GET/SET pour les DBNull.Value

Namespace PL.MetaSDK
    Public Class MetaUsers
        Private _dataRow As DataRow

        Public Sub New(ByVal dataRow As DataRow)
            Me.DataRow = dataRow
        End Sub

        Public Property UserID() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("UserID")), Nothing, Me.DataRow("UserID"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("UserID") = value
            End Set
        End Property

        Public Property ADSIobjectguid() As Guid
            Get
                Return IIf(IsDBNull(Me.DataRow("ADSIobjectguid")), Nothing, Me.DataRow("ADSIobjectguid"))
            End Get
            Set(ByVal value As Guid)
                Me.DataRow("ADSIobjectguid") = value
            End Set
        End Property

        Public Property UserName() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("UserName")), Nothing, Me.DataRow("UserName"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("UserName") = value
            End Set
        End Property

        Public Property IsGroup() As Boolean
            Get
                Return IIf(IsDBNull(Me.DataRow("IsGroup")), Nothing, Me.DataRow("IsGroup"))
            End Get
            Set(ByVal value As Boolean)
                Me.DataRow("IsGroup") = value
            End Set
        End Property

        Public Property PIN() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("PIN")), Nothing, Me.DataRow("PIN"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("PIN") = value
            End Set
        End Property

        Public Property Password() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("Password")), Nothing, Me.DataRow("Password"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("Password") = value
            End Set
        End Property

        Public Property PasswordHash() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("PasswordHash")), Nothing, Me.DataRow("PasswordHash"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("PasswordHash") = value
            End Set
        End Property

        Public Property Description() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("Description")), Nothing, Me.DataRow("Description"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("Description") = value
            End Set
        End Property

        Public Property IsLocked() As Boolean
            Get
                Return IIf(IsDBNull(Me.DataRow("IsLocked")), Nothing, Me.DataRow("IsLocked"))
            End Get
            Set(ByVal value As Boolean)
                Me.DataRow("IsLocked") = value
            End Set
        End Property

        Public Property ExpiryDate() As Date?
            Get
                Return IIf(IsDBNull(Me.DataRow("ExpiryDate")), Nothing, Me.DataRow("ExpiryDate"))
            End Get
            Set(ByVal value As Date?)
                Me.DataRow("ExpiryDate") = value
            End Set
        End Property

        Public Property IsDisabled() As Boolean
            Get
                Return IIf(IsDBNull(Me.DataRow("IsDisabled")), Nothing, Me.DataRow("IsDisabled"))
            End Get
            Set(ByVal value As Boolean)
                Me.DataRow("IsDisabled") = value
            End Set
        End Property

        Public Property SystemRecord() As Boolean
            Get
                Return IIf(IsDBNull(Me.DataRow("SystemRecord")), Nothing, Me.DataRow("SystemRecord"))
            End Get
            Set(ByVal value As Boolean)
                Me.DataRow("SystemRecord") = value
            End Set
        End Property

        Public Property Crtd_DT() As Date?
            Get
                Return IIf(IsDBNull(Me.DataRow("Crtd_DT")), Nothing, Me.DataRow("Crtd_DT"))
            End Get
            Set(ByVal value As Date?)
                Me.DataRow("Crtd_DT") = value
            End Set
        End Property

        Public Property Crtd_UId() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("Crtd_UId")), Nothing, Me.DataRow("Crtd_UId"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("Crtd_UId") = value
            End Set
        End Property

        Public Property LUpd_DT() As Date?
            Get
                Return IIf(IsDBNull(Me.DataRow("LUpd_DT")), Nothing, Me.DataRow("LUpd_DT"))
            End Get
            Set(ByVal value As Date?)
                Me.DataRow("LUpd_DT") = value
            End Set
        End Property

        Public Property LUpd_UId() As String
            Get
                Return IIf(IsDBNull(Me.DataRow("LUpd_UId")), Nothing, Me.DataRow("LUpd_UId"))
            End Get
            Set(ByVal value As String)
                Me.DataRow("LUpd_UId") = value
            End Set
        End Property

        Public Property RecordVersion() As Byte()
            Get
                Return IIf(IsDBNull(Me.DataRow("RecordVersion")), Nothing, Me.DataRow("RecordVersion"))
            End Get
            Set(ByVal value As Byte())
                Me.DataRow("RecordVersion") = value
            End Set
        End Property

        Public Property DataRow() As DataRow
            Get
                Return _dataRow
            End Get
            Set(ByVal value As DataRow)
                _dataRow = value
            End Set
        End Property

    End Class
End Namespace
